// 动态配置入口
const glob = require('glob');//glob，这个是一个全局的模块，动态配置多页面会用得着
const path = './src';

let setEntry = () => {
	let entry = {};
	//读取src目录所有的page入口
	glob.sync(`${path}/pages/*/*.js`).forEach(name => {
		let index1 = name.lastIndexOf('/');
		let index2 = name.lastIndexOf('/',index1-1)
		let entryname = name.substring(index2+1, index1);
		entry[entryname] = name;
	})
	return entry;
}

module.exports = setEntry;